﻿using System;
using ORS.OrderRobot.ServiceContracts.Dtos.Api;

namespace ORS.OrderRobot.ServiceContracts
{
	/// <summary>
	/// 用户登录服务
	/// </summary>
	public interface IAccountLoginService
	{
		/// <summary>
		/// 登录
		/// </summary>
		/// <param name="email"></param>
		/// <param name="password"></param>
		/// <returns></returns>
		Task<LoginResultInfo?> LoginAsync(string email, string password);
		/// <summary>
		///  isActive状态，并且航班信息有效的用户自动登录
		/// </summary>
		/// <returns></returns>
		Task<List<string>> AutoLoginAsync();
		/// <summary>
		/// 获取账号的登录用户信息（从缓存中）
		/// </summary>
		/// <param name="email"></param>
		/// <returns></returns>
		Task<LoginResultInfo?> GetLoginInfoAsync(string email);
        /// <summary>
        /// 获取所有已登录的账号列表
        /// </summary>
        /// <param name="onlyBoarding">只需要有登机牌的</param>
        /// <returns></returns>
        Task<List<string>> GetLoginedAccounts(bool onlyBoarding = true);
		/// <summary>
		/// 更新缓存中的登录用户信息
		/// </summary>
		/// <param name="resultInfo"></param>
		/// <returns></returns>
		Task UpdateLoginCacheInfoAsync(LoginResultInfo resultInfo);
	}
}

